/** * Copyright (c) 2020 kedacom * OpenATC is licensed under Mulan PSL v2. * You
can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at: *
http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS"
BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR
PURPOSE. * See the Mulan PSL v2 for more details. **/
<template>
  <div class="patternConfigIframe">
    <div class="rowIframe">
      <div>
        <button class="test-button">按钮开始</button>
      </div>
      <div style="width: 900PX; height: 650PX;border:1px solid red;">
        <iframe
          id="frameObj"
          :src="src"
          frameborder="0"
          scrolling="auto"
          width="100%"
          height="100%"
        ></iframe>
      </div>
    </div>
  </div>
</template>

<script>
import lineOpt from './lineOpt.json'
export default {
  name: 'TimeDistanceIframe',
  data () {
    return {
      src: 'http://localhost:9528/#/timeDistance?isShowMenu=false',
      // src: 'http://192.168.13.103:10003/openatc/#/timeDistance?isShowMenu=false',
      isShowSingle: true,
      isOnlyOneTab: true,
      isAllowedExpand: true,
      isSingleCrossMode: false,
      isShowTableHeader: true,
      tableColums: [],
      agentids: [],
      opt: {}
    }
  },
  components: {
    // Messagebox
  },
  props: {},
  watch: {},
  mounted () {
    const params = {
      method: 'init',
      data: {}
    }
    params.data = {
      'chartData': {
        'routeData': {
          'title': '协调方案123',
          'id': 1,
          'name': '测试方案下载--误删除',
          'tabName': '1',
          'content': 'Tab 1 content',
          'patternid': 1,
          'month': [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12
          ],
          'day': [
            0,
            1,
            2,
            3,
            4,
            5,
            6
          ],
          'date': [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            27,
            28,
            29,
            30,
            31
          ],
          'plan': {
            'start': '08:00',
            'end': '09:30'
          },
          'optstrategy': 'green',
          'direction': 'up',
          'upspeed': 40,
          'downspeed': 40,
          'devs': [
            {
              'id': 1,
              'name': '13013路口',
              'type': 'v-atc',
              'jsonparam': {
                'ip': '192.168.14.115',
                'port': 13013
              },
              'isused': true,
              'forwardphaseid': 2,
              'forwardphasedirection': [
                9,
                10,
                13,
                14
              ],
              'backphaseid': 1,
              'backphasedirection': [
                1,
                2,
                5,
                6
              ],
              'distance': 0,
              'width': 0,
              'sortid': 1,
              'patternid': 1,
              'agentid': '13013',
              'feature': {
                'patternList': [
                  {
                    'patternid': 1,
                    'patterndes': '',
                    'patterndesc': '方案1',
                    'id': 1,
                    'desc': '',
                    'offset': 0,
                    'cycle': 75,
                    'contrloType': 'ring',
                    'rings': [
                      [
                        {
                          'name': '相位1',
                          'id': 1,
                          'value': 40,
                          'mode': 2,
                          'delaystart': 0,
                          'advanceend': 0,
                          'options': [
                            0,
                            0,
                            0
                          ],
                          'flowperhour': 0,
                          'saturation': 1700,
                          'desc': [
                            {
                              'id': 1
                            },
                            {
                              'id': 2
                            },
                            {
                              'id': 5
                            },
                            {
                              'id': 6
                            }
                          ]
                        },
                        {
                          'name': '相位2',
                          'id': 2,
                          'value': 35,
                          'mode': 2,
                          'delaystart': 0,
                          'advanceend': 0,
                          'options': [
                            0,
                            0,
                            0
                          ],
                          'flowperhour': 0,
                          'saturation': 1700,
                          'desc': [
                            {
                              'id': 9
                            },
                            {
                              'id': 10
                            },
                            {
                              'id': 13
                            },
                            {
                              'id': 14
                            }
                          ]
                        }
                      ],
                      [],
                      [],
                      []
                    ],
                    'stages': [
                      [
                        1
                      ],
                      [
                        2
                      ]
                    ],
                    'stagesList': [
                      {
                        'key': 0,
                        'green': 0,
                        'yellow': 0,
                        'red': 0,
                        'split': 40,
                        'stageSplit': 0,
                        'phases': [
                          1
                        ]
                      },
                      {
                        'key': 1,
                        'green': 0,
                        'yellow': 0,
                        'red': 0,
                        'split': 35,
                        'stageSplit': 0,
                        'phases': [
                          2
                        ]
                      }
                    ],
                    'barriers': []
                  }
                ]
              },
              'desc': '方案1',
              'fixedtimeplantype': 'cycle-opt',
              'offset': 0,
              'cycle': 75,
              'patternId': 1,
              'patternDesc': '方案1',
              'allPatterns': [
                {
                  'patternid': 1,
                  'patterndes': '',
                  'patterndesc': '方案1',
                  'id': 1,
                  'desc': '',
                  'offset': 0,
                  'cycle': 75,
                  'contrloType': 'ring',
                  'rings': [
                    [
                      {
                        'name': '相位1',
                        'id': 1,
                        'value': 40,
                        'mode': 2,
                        'delaystart': 0,
                        'advanceend': 0,
                        'options': [
                          0,
                          0,
                          0
                        ],
                        'flowperhour': 0,
                        'saturation': 1700,
                        'desc': [
                          {
                            'id': 1
                          },
                          {
                            'id': 2
                          },
                          {
                            'id': 5
                          },
                          {
                            'id': 6
                          }
                        ]
                      },
                      {
                        'name': '相位2',
                        'id': 2,
                        'value': 35,
                        'mode': 2,
                        'delaystart': 0,
                        'advanceend': 0,
                        'options': [
                          0,
                          0,
                          0
                        ],
                        'flowperhour': 0,
                        'saturation': 1700,
                        'desc': [
                          {
                            'id': 9
                          },
                          {
                            'id': 10
                          },
                          {
                            'id': 13
                          },
                          {
                            'id': 14
                          }
                        ]
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'stagesList': [
                    {
                      'key': 0,
                      'green': 0,
                      'yellow': 0,
                      'red': 0,
                      'split': 40,
                      'stageSplit': 0,
                      'phases': [
                        1
                      ]
                    },
                    {
                      'key': 1,
                      'green': 0,
                      'yellow': 0,
                      'red': 0,
                      'split': 35,
                      'stageSplit': 0,
                      'phases': [
                        2
                      ]
                    }
                  ],
                  'barriers': []
                }
              ],
              'currPhase': [
                {
                  'id': 1,
                  'direction': [
                    1,
                    2,
                    5,
                    6
                  ],
                  'peddirection': [],
                  'mingreen': 15,
                  'max1': 50,
                  'max2': 80,
                  'passage': 3,
                  'phasewalk': 0,
                  'pedclear': 0,
                  'yellow': 3,
                  'redclear': 2,
                  'flashgreen': 6,
                  'redyellow': 0,
                  'ring': 1,
                  'greenpulse': 9,
                  'redpulse': 9,
                  'vehiclethresh': 30,
                  'pedestrianthresh': 30,
                  'controltype': 0,
                  'concurrent': []
                },
                {
                  'id': 2,
                  'direction': [
                    9,
                    10,
                    13,
                    14
                  ],
                  'peddirection': [],
                  'mingreen': 15,
                  'max1': 50,
                  'max2': 80,
                  'passage': 3,
                  'phasewalk': 0,
                  'pedclear': 0,
                  'yellow': 3,
                  'redclear': 2,
                  'flashgreen': 6,
                  'redyellow': 0,
                  'ring': 1,
                  'greenpulse': 9,
                  'redpulse': 9,
                  'vehiclethresh': 30,
                  'pedestrianthresh': 30,
                  'controltype': 0,
                  'concurrent': []
                }
              ],
              'phaseList': [
                {
                  'id': 1,
                  'direction': [
                    1,
                    2,
                    5,
                    6
                  ],
                  'peddirection': [],
                  'mingreen': 15,
                  'max1': 50,
                  'max2': 80,
                  'passage': 3,
                  'phasewalk': 0,
                  'pedclear': 0,
                  'yellow': 3,
                  'redclear': 2,
                  'flashgreen': 6,
                  'redyellow': 0,
                  'ring': 1,
                  'greenpulse': 9,
                  'redpulse': 9,
                  'vehiclethresh': 30,
                  'pedestrianthresh': 30,
                  'controltype': 0,
                  'concurrent': []
                },
                {
                  'id': 2,
                  'direction': [
                    9,
                    10,
                    13,
                    14
                  ],
                  'peddirection': [],
                  'mingreen': 15,
                  'max1': 50,
                  'max2': 80,
                  'passage': 3,
                  'phasewalk': 0,
                  'pedclear': 0,
                  'yellow': 3,
                  'redclear': 2,
                  'flashgreen': 6,
                  'redyellow': 0,
                  'ring': 1,
                  'greenpulse': 9,
                  'redpulse': 9,
                  'vehiclethresh': 30,
                  'pedestrianthresh': 30,
                  'controltype': 0,
                  'concurrent': []
                }
              ],
              'rings': [
                [
                  {
                    'name': '相位1',
                    'id': 1,
                    'value': 40,
                    'mode': 2,
                    'delaystart': 0,
                    'advanceend': 0,
                    'options': [
                      0,
                      0,
                      0
                    ],
                    'flowperhour': 0,
                    'saturation': 1700,
                    'desc': [
                      {
                        'id': 1
                      },
                      {
                        'id': 2
                      },
                      {
                        'id': 5
                      },
                      {
                        'id': 6
                      }
                    ]
                  },
                  {
                    'name': '相位2',
                    'id': 2,
                    'value': 35,
                    'mode': 2,
                    'delaystart': 0,
                    'advanceend': 0,
                    'options': [
                      0,
                      0,
                      0
                    ],
                    'flowperhour': 0,
                    'saturation': 1700,
                    'desc': [
                      {
                        'id': 9
                      },
                      {
                        'id': 10
                      },
                      {
                        'id': 13
                      },
                      {
                        'id': 14
                      }
                    ]
                  }
                ],
                [],
                [],
                []
              ],
              'stagesList': [
                {
                  'key': 0,
                  'green': 0,
                  'yellow': 0,
                  'red': 0,
                  'split': 40,
                  'stageSplit': 0,
                  'phases': [
                    1
                  ]
                },
                {
                  'key': 1,
                  'green': 0,
                  'yellow': 0,
                  'red': 0,
                  'split': 35,
                  'stageSplit': 0,
                  'phases': [
                    2
                  ]
                }
              ],
              'ringCount': [
                1
              ],
              'patternList': [
                {
                  'patternid': 1,
                  'patterndes': '',
                  'patterndesc': '方案1',
                  'id': 1,
                  'desc': '',
                  'offset': 0,
                  'cycle': 75,
                  'contrloType': 'ring',
                  'rings': [
                    [
                      {
                        'name': '相位1',
                        'id': 1,
                        'value': 40,
                        'mode': 2,
                        'delaystart': 0,
                        'advanceend': 0,
                        'options': [
                          0,
                          0,
                          0
                        ],
                        'flowperhour': 0,
                        'saturation': 1700,
                        'desc': [
                          {
                            'id': 1
                          },
                          {
                            'id': 2
                          },
                          {
                            'id': 5
                          },
                          {
                            'id': 6
                          }
                        ]
                      },
                      {
                        'name': '相位2',
                        'id': 2,
                        'value': 35,
                        'mode': 2,
                        'delaystart': 0,
                        'advanceend': 0,
                        'options': [
                          0,
                          0,
                          0
                        ],
                        'flowperhour': 0,
                        'saturation': 1700,
                        'desc': [
                          {
                            'id': 9
                          },
                          {
                            'id': 10
                          },
                          {
                            'id': 13
                          },
                          {
                            'id': 14
                          }
                        ]
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'stagesList': [
                    {
                      'key': 0,
                      'green': 0,
                      'yellow': 0,
                      'red': 0,
                      'split': 40,
                      'stageSplit': 0,
                      'phases': [
                        1
                      ]
                    },
                    {
                      'key': 1,
                      'green': 0,
                      'yellow': 0,
                      'red': 0,
                      'split': 35,
                      'stageSplit': 0,
                      'phases': [
                        2
                      ]
                    }
                  ],
                  'barriers': []
                }
              ]
            },
            {
              'id': 1,
              'name': '金门路枫桥路13011',
              'type': 'v-atc',
              'jsonparam': {
                'ip': '192.168.14.115',
                'port': 13011
              },
              'isused': true,
              'forwardphaseid': 1,
              'forwardphasedirection': [
                1,
                5
              ],
              'backphaseid': 1,
              'backphasedirection': [
                1,
                5
              ],
              'distance': 500,
              'width': 0,
              'sortid': 2,
              'patternid': 1,
              'agentid': 'jmlfql',
              'feature': {
                'patternList': [
                  {
                    'patternid': 1,
                    'patterndes': '方案1',
                    'patterndesc': '方案1',
                    'id': 1,
                    'desc': '方案1',
                    'offset': 50,
                    'cycle': 100,
                    'rings': [
                      [
                        {
                          'id': 1,
                          'value': 50,
                          'mode': 2,
                          'delaystart': 0,
                          'advanceend': 0,
                          'flowperhour': 0,
                          'saturation': 1700,
                          'desc': [
                            {
                              'id': 1
                            },
                            {
                              'id': 5
                            }
                          ]
                        },
                        {
                          'id': 2,
                          'value': 50,
                          'mode': 2,
                          'delaystart': 0,
                          'advanceend': 0,
                          'flowperhour': 0,
                          'saturation': 1700,
                          'desc': []
                        }
                      ],
                      [],
                      [],
                      []
                    ],
                    'stages': [
                      [
                        1
                      ],
                      [
                        2
                      ]
                    ],
                    'stagesList': [
                      {
                        'key': 0,
                        'green': 0,
                        'yellow': 0,
                        'red': 0,
                        'split': 30,
                        'stageSplit': 0,
                        'stages': []
                      },
                      {
                        'key': 0,
                        'green': 0,
                        'yellow': 0,
                        'red': 0,
                        'split': 30,
                        'stageSplit': 0,
                        'stages': []
                      }
                    ],
                    'barriers': []
                  }
                ]
              },
              'desc': '方案1',
              'fixedtimeplantype': 'cycle-opt',
              'offset': 50,
              'cycle': 100,
              'patternId': 1,
              'patternDesc': '方案1',
              'allPatterns': [
                {
                  'patternid': 1,
                  'patterndes': '方案1',
                  'patterndesc': '方案1',
                  'id': 1,
                  'desc': '方案1',
                  'offset': 50,
                  'cycle': 100,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 50,
                        'mode': 2,
                        'delaystart': 0,
                        'advanceend': 0,
                        'flowperhour': 0,
                        'saturation': 1700,
                        'desc': [
                          {
                            'id': 1
                          },
                          {
                            'id': 5
                          }
                        ]
                      },
                      {
                        'id': 2,
                        'value': 50,
                        'mode': 2,
                        'delaystart': 0,
                        'advanceend': 0,
                        'flowperhour': 0,
                        'saturation': 1700,
                        'desc': []
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'stagesList': [
                    {
                      'key': 0,
                      'green': 0,
                      'yellow': 0,
                      'red': 0,
                      'split': 30,
                      'stageSplit': 0,
                      'stages': []
                    },
                    {
                      'key': 0,
                      'green': 0,
                      'yellow': 0,
                      'red': 0,
                      'split': 30,
                      'stageSplit': 0,
                      'stages': []
                    }
                  ],
                  'barriers': []
                }
              ],
              'currPhase': [
                {
                  'id': 1,
                  'direction': [
                    1,
                    5
                  ],
                  'peddirection': [],
                  'mingreen': 6,
                  'max1': 120,
                  'max2': 180,
                  'passage': 3,
                  'phasewalk': 0,
                  'pedclear': 0,
                  'yellow': 3,
                  'redclear': 2,
                  'flashgreen': 3,
                  'redyellow': 0,
                  'ring': 1,
                  'greenpulse': 5,
                  'redpulse': 10,
                  'vehiclethresh': 30,
                  'pedestrianthresh': 30,
                  'linkphase': '',
                  'controltype': 0,
                  'concurrent': []
                },
                {
                  'id': 2,
                  'direction': [],
                  'peddirection': [
                    16
                  ],
                  'mingreen': 6,
                  'max1': 120,
                  'max2': 180,
                  'passage': 3,
                  'phasewalk': 0,
                  'pedclear': 0,
                  'yellow': 3,
                  'redclear': 2,
                  'flashgreen': 3,
                  'redyellow': 0,
                  'ring': 1,
                  'greenpulse': 5,
                  'redpulse': 10,
                  'vehiclethresh': 30,
                  'pedestrianthresh': 30,
                  'linkphase': '',
                  'controltype': 2,
                  'concurrent': []
                }
              ],
              'phaseList': [
                {
                  'id': 1,
                  'direction': [
                    1,
                    5
                  ],
                  'peddirection': [],
                  'mingreen': 6,
                  'max1': 120,
                  'max2': 180,
                  'passage': 3,
                  'phasewalk': 0,
                  'pedclear': 0,
                  'yellow': 3,
                  'redclear': 2,
                  'flashgreen': 3,
                  'redyellow': 0,
                  'ring': 1,
                  'greenpulse': 5,
                  'redpulse': 10,
                  'vehiclethresh': 30,
                  'pedestrianthresh': 30,
                  'linkphase': '',
                  'controltype': 0,
                  'concurrent': []
                },
                {
                  'id': 2,
                  'direction': [],
                  'peddirection': [
                    16
                  ],
                  'mingreen': 6,
                  'max1': 120,
                  'max2': 180,
                  'passage': 3,
                  'phasewalk': 0,
                  'pedclear': 0,
                  'yellow': 3,
                  'redclear': 2,
                  'flashgreen': 3,
                  'redyellow': 0,
                  'ring': 1,
                  'greenpulse': 5,
                  'redpulse': 10,
                  'vehiclethresh': 30,
                  'pedestrianthresh': 30,
                  'linkphase': '',
                  'controltype': 2,
                  'concurrent': []
                }
              ],
              'rings': [
                [
                  {
                    'id': 1,
                    'value': 50,
                    'mode': 2,
                    'delaystart': 0,
                    'advanceend': 0,
                    'flowperhour': 0,
                    'saturation': 1700,
                    'desc': [
                      {
                        'id': 1
                      },
                      {
                        'id': 5
                      }
                    ]
                  },
                  {
                    'id': 2,
                    'value': 50,
                    'mode': 2,
                    'delaystart': 0,
                    'advanceend': 0,
                    'flowperhour': 0,
                    'saturation': 1700,
                    'desc': []
                  }
                ],
                [],
                [],
                []
              ],
              'stagesList': [
                {
                  'key': 0,
                  'green': 0,
                  'yellow': 0,
                  'red': 0,
                  'split': 30,
                  'stageSplit': 0,
                  'stages': []
                },
                {
                  'key': 0,
                  'green': 0,
                  'yellow': 0,
                  'red': 0,
                  'split': 30,
                  'stageSplit': 0,
                  'stages': []
                }
              ],
              'ringCount': [
                1
              ],
              'patternList': [
                {
                  'patternid': 1,
                  'patterndes': '方案1',
                  'patterndesc': '方案1',
                  'id': 1,
                  'desc': '方案1',
                  'offset': 50,
                  'cycle': 100,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 50,
                        'mode': 2,
                        'delaystart': 0,
                        'advanceend': 0,
                        'flowperhour': 0,
                        'saturation': 1700,
                        'desc': [
                          {
                            'id': 1
                          },
                          {
                            'id': 5
                          }
                        ]
                      },
                      {
                        'id': 2,
                        'value': 50,
                        'mode': 2,
                        'delaystart': 0,
                        'advanceend': 0,
                        'flowperhour': 0,
                        'saturation': 1700,
                        'desc': []
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'stagesList': [
                    {
                      'key': 0,
                      'green': 0,
                      'yellow': 0,
                      'red': 0,
                      'split': 30,
                      'stageSplit': 0,
                      'stages': []
                    },
                    {
                      'key': 0,
                      'green': 0,
                      'yellow': 0,
                      'red': 0,
                      'split': 30,
                      'stageSplit': 0,
                      'stages': []
                    }
                  ],
                  'barriers': []
                }
              ]
            }
          ],
          'duration': 300,
          'continueOnfailure': false,
          'keyintsid': '13013'
        },
        'patternList': [
          {
            'agentid': '13013',
            'feature': {
              'patternList': [
                {
                  'id': 1,
                  'desc': 'Pattern 1',
                  'offset': 0,
                  'cycle': 75,
                  'rings': [
                    [
                      {
                        'name': '相位1',
                        'id': 1,
                        'value': 40,
                        'mode': 2,
                        'options': [
                          0,
                          0,
                          0
                        ],
                        'minSplit': 11,
                        'delaystart': 0,
                        'advanceend': 0
                      },
                      {
                        'name': '相位2',
                        'id': 2,
                        'value': 35,
                        'mode': 2,
                        'options': [
                          0,
                          0,
                          0
                        ],
                        'minSplit': 11,
                        'delaystart': 0,
                        'advanceend': 0
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'contrloType': 'ring',
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'overlapCycle': 75,
                  'barriers': [],
                  'stagesList': [
                    {
                      'key': 0,
                      'split': 40,
                      'phases': [
                        1
                      ],
                      'delaystart': 0,
                      'advanceend': 0
                    },
                    {
                      'key': 1,
                      'split': 35,
                      'phases': [
                        2
                      ],
                      'delaystart': 0,
                      'advanceend': 0
                    }
                  ],
                  'special': []
                }
              ]
            }
          },
          {
            'agentid': 'jmlfql',
            'feature': {
              'patternList': [
                {
                  'id': 1,
                  'desc': '方案1',
                  'offset': 50,
                  'cycle': 100,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 50,
                        'mode': 2
                      },
                      {
                        'id': 2,
                        'value': 50,
                        'mode': 2
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stagesList': [
                    {
                      'split': 30,
                      'stages': []
                    },
                    {
                      'split': 30,
                      'stages': []
                    }
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'barriers': []
                },
                {
                  'id': 2,
                  'desc': '222-协调方案 1',
                  'offset': 0,
                  'cycle': 60,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 30,
                        'mode': 2
                      },
                      {
                        'id': 2,
                        'value': 30,
                        'mode': 2
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stagesList': [
                    {
                      'split': 30,
                      'stages': []
                    },
                    {
                      'split': 30,
                      'stages': []
                    }
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'barriers': []
                },
                {
                  'id': 3,
                  'desc': '测试很多路口很大消息-�',
                  'offset': 50,
                  'cycle': 100,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 50,
                        'mode': 2
                      },
                      {
                        'id': 2,
                        'value': 50,
                        'mode': 2
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stagesList': [
                    {
                      'split': 30,
                      'stages': []
                    },
                    {
                      'split': 30,
                      'stages': []
                    }
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'barriers': []
                },
                {
                  'id': 4,
                  'desc': '测试很多路口很大消息-�',
                  'offset': 50,
                  'cycle': 100,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 50,
                        'mode': 2
                      },
                      {
                        'id': 2,
                        'value': 50,
                        'mode': 2
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stagesList': [
                    {
                      'split': 30,
                      'stages': []
                    },
                    {
                      'split': 30,
                      'stages': []
                    }
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'barriers': []
                }
              ]
            }
          }
        ],
        'greenwave': [],
        'allPatternList': [
          {
            'agentid': '13013',
            'feature': {
              'patternList': [
                {
                  'id': 1,
                  'desc': 'Pattern 1',
                  'offset': 0,
                  'cycle': 75,
                  'rings': [
                    [
                      {
                        'name': '相位1',
                        'id': 1,
                        'value': 40,
                        'mode': 2,
                        'options': [
                          0,
                          0,
                          0
                        ],
                        'minSplit': 11,
                        'delaystart': 0,
                        'advanceend': 0
                      },
                      {
                        'name': '相位2',
                        'id': 2,
                        'value': 35,
                        'mode': 2,
                        'options': [
                          0,
                          0,
                          0
                        ],
                        'minSplit': 11,
                        'delaystart': 0,
                        'advanceend': 0
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'contrloType': 'ring',
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'overlapCycle': 75,
                  'barriers': [],
                  'stagesList': [
                    {
                      'key': 0,
                      'split': 40,
                      'phases': [
                        1
                      ],
                      'delaystart': 0,
                      'advanceend': 0
                    },
                    {
                      'key': 1,
                      'split': 35,
                      'phases': [
                        2
                      ],
                      'delaystart': 0,
                      'advanceend': 0
                    }
                  ],
                  'special': []
                }
              ]
            }
          },
          {
            'agentid': 'jmlfql',
            'feature': {
              'patternList': [
                {
                  'id': 1,
                  'desc': '方案1',
                  'offset': 50,
                  'cycle': 100,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 50,
                        'mode': 2
                      },
                      {
                        'id': 2,
                        'value': 50,
                        'mode': 2
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stagesList': [
                    {
                      'split': 30,
                      'stages': []
                    },
                    {
                      'split': 30,
                      'stages': []
                    }
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'barriers': []
                },
                {
                  'id': 2,
                  'desc': '222-协调方案 1',
                  'offset': 0,
                  'cycle': 60,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 30,
                        'mode': 2
                      },
                      {
                        'id': 2,
                        'value': 30,
                        'mode': 2
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stagesList': [
                    {
                      'split': 30,
                      'stages': []
                    },
                    {
                      'split': 30,
                      'stages': []
                    }
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'barriers': []
                },
                {
                  'id': 3,
                  'desc': '测试很多路口很大消息-�',
                  'offset': 50,
                  'cycle': 100,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 50,
                        'mode': 2
                      },
                      {
                        'id': 2,
                        'value': 50,
                        'mode': 2
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stagesList': [
                    {
                      'split': 30,
                      'stages': []
                    },
                    {
                      'split': 30,
                      'stages': []
                    }
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'barriers': []
                },
                {
                  'id': 4,
                  'desc': '测试很多路口很大消息-�',
                  'offset': 50,
                  'cycle': 100,
                  'rings': [
                    [
                      {
                        'id': 1,
                        'value': 50,
                        'mode': 2
                      },
                      {
                        'id': 2,
                        'value': 50,
                        'mode': 2
                      }
                    ],
                    [],
                    [],
                    []
                  ],
                  'stagesList': [
                    {
                      'split': 30,
                      'stages': []
                    },
                    {
                      'split': 30,
                      'stages': []
                    }
                  ],
                  'stages': [
                    [
                      1
                    ],
                    [
                      2
                    ]
                  ],
                  'barriers': []
                }
              ]
            }
          }
        ]
      },
      'devicesData': [
        {
          'id': 1549562,
          'lastTime': '2024-09-26 11:22:31',
          'type': 'v-atc',
          'status': 0,
          'state': 'UP',
          'geometry': {
            'type': 'Point',
            'coordinates': [
              121.56038673310259,
              31.186048847988182
            ]
          },
          'jsonparam': {
            'ip': '192.168.14.115',
            'port': 13013
          },
          'agentid': '13013',
          'protocol': 'ocp',
          'name': '13013路口',
          'code': '苏州',
          'platform': 'OpenATC',
          'thirdplatformid': '13013',
          'sockettype': 0,
          'tags': '',
          'mode': 0,
          'control': 5,
          'patternid': 1
        },
        {
          'id': 1546337,
          'lastTime': '2024-09-26 11:22:31',
          'type': 'v-atc',
          'status': 0,
          'state': 'UP',
          'geometry': {
            'type': 'Point',
            'coordinates': [
              121.56284093856813,
              31.189840767823352
            ]
          },
          'jsonparam': {
            'ip': '192.168.14.115',
            'port': 13011
          },
          'agentid': 'jmlfql',
          'protocol': 'ocp',
          'name': '金门路枫桥路13011',
          'code': '苏州',
          'platform': 'OpenATC',
          'thirdplatformid': '13011',
          'sockettype': 0,
          'tags': '',
          'mode': 0,
          'control': 5,
          'patternid': 1
        }
      ],
      'greenWaveParam': {
        'greenWave': {
          'up': {
            'type': 'up',
            'distance': 500,
            'start': 0,
            'width': 0,
            'widthmin': 0,
            'speed': 40,
            'vehicle': 0
          },
          'down': {
            'type': 'down',
            'distance': 500,
            'start': 0,
            'width': 0,
            'widthmin': 0,
            'speed': 40,
            'vehicle': 0
          }
        },
        'realtimeGreenWave': {
          'up': {
            'type': 'up',
            'distance': 500,
            'start': 0,
            'width': 0,
            'widthmin': 0,
            'speed': 40,
            'vehicle': 0
          },
          'down': {
            'type': 'down',
            'distance': 500,
            'start': 0,
            'width': 0,
            'widthmin': 0,
            'speed': 40,
            'vehicle': 0
          }
        }
      }
    }
    console.log('params: ', params)
    let params2 = {
      method: 'init',
      data: {}
    }
    let greenWaveUP = lineOpt.routeopt.greenwave.find(item => item.type === 'up')
    let greenWaveDown = lineOpt.routeopt.greenwave.find(item => item.type === 'down')
    let greenWave = {
      up: greenWaveUP,
      down: greenWaveDown
    }
    lineOpt.routeopt.upspeed = greenWave.up.speed
    lineOpt.routeopt.downspeed = greenWave.down.speed
    let targetData = {
      'chartData': {
        routeData: lineOpt.routeopt,
        greenwave: [],
        patternList: lineOpt.routeopt.devs,
        allPatternList: lineOpt.routeopt.devs
      },
      devicesData: lineOpt.intersectionoptimizeresults,
      greenWaveParam: {
        greenWave: greenWave,
        realtimeGreenWave: greenWave
      }
    }
    params2.data = targetData
    console.log('params2: ', params2)
    // 容器父页面js代码
    // @ts-ignore
    document.querySelector('.test-button').addEventListener('click', () => {
      // * 表示向所有的iframe发送信息，指定url，就可以定向发送信息
      // @ts-ignore
      document.getElementById('frameObj').contentWindow.postMessage(params2)
    })
  },
  destroyed () {}
}
</script>

<style lang="scss" scoped>
.patternConfig {
  // width: 800px;
  // height: 500px;
  // border: 1px solid red;
  .row {
    flex: 1;
    overflow: auto;
    width: 100%;
  }
}
</style>
